<!--
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-12 07:43:11
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-12 12:27:07
 * @FilePath: \vue3_admin_template\project\src\views\screen\component\Couter\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A
-->
<template>
  <div class="box8">
    <p class="title">渠道统计</p>
    <p class="bg"></p>
    <div class="echart" ref="echart"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
//获取图形图表的DOM节点
let echart = ref()
const option = {
  color: ['#67F9D8', '#FFE434', '#56A3F1', '#FF917C'],
  title: {
    text: '徐虹北邻里汇12月综合得分93.3分',
    left: '40',
    top: '80',
    textStyle: {
      fontStyle: 'normal', //风格
      fontWeight: 'normal', //粗细
      fontFamily: 'Microsoft yahei', //字体
      fontSize: 14, //大小
      align: 'center', //水平对齐
    },
  },
  radar: [
    {
      indicator: [
        { text: '服务供给(30分)' },
        { text: '满意度(30分)' },
        { text: '单位面积人气(40分)' },
      ],
      center: ['45%', '48%'],
      radius: 100,
      startAngle: 90,
      splitNumber: 4,
      shape: 'circle',
      axisName: {
        formatter: '{value}',
        color: '#428BD4',
      },
      splitArea: {
        areaStyle: {
          color: ['#77EADF', '#26C3BE', '#64AFE9', '#428BD4'],
          shadowColor: 'rgba(0, 0, 0, 0.2)',
          shadowBlur: 10,
        },
      },
      axisLine: {
        lineStyle: {
          color: 'rgba(211, 253, 250, 0.8)',
        },
      },
      splitLine: {
        lineStyle: {
          color: 'rgba(211, 253, 250, 0.8)',
        },
      },
    },
  ],
  series: [
    {
      type: 'radar',
      emphasis: {
        lineStyle: {
          width: 4,
        },
      },
      data: [
        {
          value: [24, 29.3, 40],
          name: 'Data B',
          label: {
            show: true,
            formatter: function (params: any) {
              return params.value
            },
          },
          areaStyle: {
            color: 'rgba(255, 228, 52, 0.6)',
          },
        },
      ],
    },
  ],
}
onMounted(() => {
  //初始化Echarts实例
  let myEcharts = echarts.init(echart.value)
  //  初始化配置项
  myEcharts.setOption(option)
})
</script>

<style lang="scss" scoped>
.box8 {
  margin: 10px 0px 0 0;
  width: 100%;
  height: 100%;
  background: url('../../images/dataScreen-main-cb.png') no-repeat;
  background-size: 100% 100%;
  .title {
    color: #fff;
    font-size: 20px;
    // margin-top: 10px;
  }
  .bg {
    width: 68px;
    height: 7px;
    background: url('../../images/dataScreen-title.png') no-repeat;
    background-size: 100% 100%;
    margin: 10px 0 0 20px;
  }

  .echart {
    width: 100%;
    height: calc(100% - 50px);
    // background-color: red;
  }
}
</style>
